#pragma once
#include <vector>
#include <d3d9.h>
#include "RenderOperation.h"
#include "Renderer.h"

class Node;
class Camera;
class Mesh;
class MeshLoader;
class Scene
{
	Node *rootNode;
	std::vector<Camera*> cameras;
	std::vector<Mesh*>	meshes;
	Camera *activeCamera;
	int width;
	int height;
	IDirect3DDevice9 *device;
	Renderer renderer;

	Material *stdmtrl;
protected:
	//pre render functions
	std::vector<RenderOperation> MakeRenderOperationList();
	void CullMeshes();
public:
	Scene(int width, int height, IDirect3DDevice9 *device);
	~Scene();

	void Render();
	Camera* CreateCamera();
	Mesh*	CreateMesh(MeshLoader *mload);
	Node*	CreatePivot();
};